home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
monitory
/
amyload
/
openloadwindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-15
|
2KB
|
70 lines
#include <intuition/intuition.h>
#include <devices/load.h>
#include "execdef.h"
#include "intuidef.h"
#include "windownode.h"
#include "windowinfo.h"
#include "OpenLoadWindow.proto"
#include <intuition/proto.h>
#include <exec/proto.h>
#include <graphics/proto.h>
#include "SetWindowInfo.proto"
#include "PrintMessage.proto"
extern MsgPort *windowPort;
extern MinList windowList;
static ULONG IDCMPFlags = MOUSEBUTTONS | CLOSEWINDOW | NEWSIZE | REFRESHWINDOW;
static char *myname = "Amyload by";
static char *myauthor = "Jeff Kelley";
WindowNode *
OpenLoadWindow(new_window, back_pen_num)
NewWindow *new_window;
unsigned char back_pen_num;
{
WindowNode *windownode;
Window *window;
WindowInfo *window_info;
Gadget *gadget;
if (!(windownode = (WindowNode *)AllocMem(sizeof(WindowNode), 0)))
return NULL;
if (!(window = OpenWindow(new_window)))
{
FreeMem((char *)windownode, sizeof(WindowNode));
return NULL;
}
windownode->window = window;
if (!(window_info = (WindowInfo *)AllocMem(sizeof(WindowInfo), 0)))
{
FreeMem((char *)windownode, sizeof(WindowNode));
CloseWindow(window);
return NULL;
}
window->UserData = (char *)window_info;
NewList(&window_info->loadrecords);
SetWindowInfo(window);
window_info->back_pen_num = back_pen_num;
for (gadget = window->FirstGadget; gadget; gadget = gadget->NextGadget)
{
gadget->GadgetRender = NULL;
gadget->SelectRender = NULL;
}
RefreshWindowFrame(window);
SetAPen(window->RPort, back_pen_num);
RectFill(window->RPort, window_info->leftedge,
window_info->topedge,
window_info->rightedge,
window_info->bottomedge);
PrintMessage(window, myname, (short)1, (unsigned char)1);
PrintMessage(window, myauthor, (short)2, (unsigned char)3);
window->UserPort = windowPort;
ModifyIDCMP(window, IDCMPFlags);
AddTail(&windowList, &windownode->node);
return windownode;
}